package net.cloudcodex.client.home.view.panel.campaign;

import java.util.ArrayList;
import java.util.List;

import net.cloudcodex.client.home.view.HomeCampaignView;
import net.cloudcodex.client.home.view.HomeView.Message;

import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.Label;

public class HomeCampaignsPanel extends FlowPanel {

	private final Label titlePanel = new Label();
	private Message message;
	private Button addCampaignButton = new Button();

	public HomeCampaignsPanel() {
		this.add(titlePanel);
	}

	public void initComponents() {
		titlePanel.setStyleName("titlePanel");
		titlePanel.setText(message.getCampaignsTitle());
	
		this.setStyleName("homeCampaignsPanel");
		
		addCampaignButton.setText(message.getAddCampaignButton());
		this.add(addCampaignButton);
	}

	
	public void setMessage(Message message) {
		this.message = message ;		
	}
	

	public void addView(HomeCampaignView campaignView) {
		this.remove(addCampaignButton);
		this.add(campaignView);
		this.add(addCampaignButton);
	}

	public HasClickHandlers getAddCampaignButton(){
		return addCampaignButton;
	}

}
